<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/header.css" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/footer.css" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/cart.css" />
	<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/cart.js"></script>
	<script type="text/javascript">
		var del_some_url = "{:U('Cart/delSome')}";
		var cart_index_url = "{:U('Cart/index')}";
		var add_order_url = "{:U('Cart/addOrder')}";
		var success_order_url = "{:U('Cart/successOrder')}";
	</script>
</head>
<body>
	<!-- 头部区域 开始 -->
	<include file="Common:header" />
	<!-- 头部区域 结束 -->

	<!-- 主体 区域 开始 -->
	<div class="main">
		<h1 id="mycart">我的购物车</h1>
		<!-- 购物车 进度条 开始 -->
		<div id='shop_menu'>
			<ul>
				<li <?php if(ACTION_NAME == 'index'): ?>class='shop_car'<?php endif; ?>>购物车<b>></b></li>
				<li <?php if(ACTION_NAME == 'confirmOrder'): ?>class='shop_car'<?php endif; ?>>确认订单信息<b>></b></li>
				<li <?php if(ACTION_NAME == 'successOrder'): ?>class='shop_car'<?php endif; ?>>提交订单成功<b>></b></li>
				<li <?php if(ACTION_NAME == 'buyOk'): ?>class='shop_car'<?php endif; ?>>确认收货</li>
			</ul>
		</div>
		<!-- 购物车 进度条 结束 -->
	<?php if(ACTION_NAME == 'index'): ?>
		<!-- 购物车没商品 开始 -->
		<?php if(!isset($_SESSION['cart'])): ?>
		<div id='cart_bg'>
			<p>购物车内暂时没有商品，您可以
				<a href="__ROOT__">去首页</a>
				挑选喜欢的商品</p>
		</div>
		<!-- 购物车没有商品结束 -->
		<?php else: ?>
		<!-- 购物车有商品 开始 -->
		<div class='count_goods'>
			<form action="" id='list'>
				<ul>
					<li class='select'>
						<label id='entire'><input type="checkbox" class='box'/>全选</label>
					</li>
					<li class='goods_name'>商品名称</li>
					<li class='number'>售价</li>
					<li class='number'>数量</li>
					<li class='number'>小计</li>
					<li class='number'>操作</li>			
				</ul>
				<foreach name="info" item="v">
				<ul class='goods_list'>
					<li class='select'>
						<label><input type="checkbox" class='box' sessionKey={$v.session_key} /></label>
					</li>
					<li class='goods_name'>
						<a href="{:U('Show/index', array('gid' => $v['gid']))}" title=''><img src="__UPLOADS__/Photo/{$v.pic}" alt="" /></a>
					</li>
					<li class='detail'>
						<a href="{:U('Show/index', array('gid' => $v['gid']))}">{$v.gname}</a>
						<p>颜色: <span>{$v.color}</span>&nbsp;&nbsp;&nbsp;尺码: <span>{$v.size}</span></p>
					</li>
					<li class='number'>¥{$v.price}.00</li>
					<li class='number'>{$v.quantity}</li>
					<li class='number'>¥{$v.sum}.00</li>
					<li class='number'><a href="{:U('Cart/delOne', array('session_key' => $v['session_key']))}" class='delete'>删除</a></li>	
				</ul>
				</foreach>
				<ul class='del'>
					<li> 
						<span id="del_some">删除选中的商品</span>
						<p>购物金额总计:<span style='color:#BF0000;font-size:20px;font-weight: bold;'>¥{$totalPrice}.00</span></p>
					</li>
				</ul>
				<ul class='jxgw'>
					<li>
						<a href="__ROOT__" class='jx'><img src="__PUBLIC__/Images/jxgw.png" alt="" /></a>
						<a href="{:U('Cart/confirmOrder')}" class='js'><img src="__PUBLIC__/Images/jszx.png" alt="" /></a>
					</li>
				</ul>
			</form>
		</div>
		<!-- 购物车有商品结束 -->
		<?php endif; ?>
	<?php endif; ?>

	<?php if(ACTION_NAME == 'confirmOrder'): ?>
		<!-- 确认订单信息页 开始 -->
		<div class='count_goods'>
			<form action="">
				<ul>
					<li class='write'>
						请填写并核对订单信息
					</li>
				</ul>
				
				<ul class='form_info'>
					<div>
						<p class='info_name'><b>*</b>&nbsp;收货人:</p>
						<input type="text" name='consignee' class='info_text'/>
						<span id="consignee_warn">收货人不能为空</span>

						<p class='info_date'><b>*</b>&nbsp;收货地址:</p>
						<input type="text" name='address' class='info_address'/>
						<span id="address_warn">收货地址不能为空</span>

						<p class='info_phone'><b>*</b>&nbsp;联系电话:</p>
						<input type="text" name='mobile' class='info_numb'/>
						<span id="phone_warn">联系电话不能为空</span>

						<a href="" class='determine'>确定收货地址</a>
					</div>
				</ul>
				<ul>
					<li class='number' id="pic_text">商品图片</li>
					<li class='goods_name'>商品名称</li>
					<li class='number'>颜色尺码</li>
					<li class='number'>单价</li>
					<li class='number'>数量</li>
					<li class='number'>小计</li>			
				</ul>

				<foreach name="info" item="v">
				<ul class='goods_list'>
					<li class='number' id="pic_img">
						<a href="{:U('Show/index', array('gid' => $v['gid']))}" title=''><img src="__UPLOADS__/Photo/{$v.pic}" alt="" /></a>
					</li>
					<li class='goods_name_info'>
						<a href="{:U('Show/index', array('gid' => $v['gid']))}">{$v.gname}</a>
					</li>
					<li class='number'><p>颜色:<span>{$v.color}</span>&nbsp;尺码:<span>{$v.size}</span></p></li>
					<li class='number'>¥{$v.price}.00</li>
					<li class='number'>{$v.quantity}</li>
					<li class='number'>¥{$v.sum}.00</li>	
				</ul>
				</foreach>

				<ul class='goods_list'>
					<div class='addition'>
						<p class='messg'>附加留言</p><input type="text" name="remark" class='messg_info'/>
						<p class='pay'>支付方式:</p><img src="__PUBLIC__/Images/third.png" alt="" class='third'/>
						<p class='total'>商品总价: ¥{$totalPrice}.00</p>
						<p class='amount'>您共需要为订单支付</p><strong class='whole'>¥{$totalPrice}.00</strong>
						<input type="button" class='submit_btn' value=''/>
					</div>
				</ul>
			</form>
		</div>
		<!-- 确认订单信息页 结束 -->
	<?php endif; ?>

	<?php if(ACTION_NAME == 'successOrder'): ?>
		<!-- 提交订单成功页 开始 -->
		<div id='success'>
			<h3>恭喜您,订单提交成功,请您尽快付款！</h3>
			<a href="{:U('Cart/alipay')}" class='lkzf'>立即去支付</a>
		</div>
		<!-- 提交订单成功页 结束 -->
	<?php endif; ?>


	</div>
	<!-- 主体 区域 结束 -->



	<!-- 页脚 部分 开始 -->
	<include file="Common:footer" />
	<!-- 页脚 部分 结束 -->

</body>
</html>